/*    */ package com.zimbra.cs.service.admin;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.accesscontrol.AdminRight;
/*    */ import com.zimbra.cs.account.accesscontrol.Rights.Admin;
/*    */ import com.zimbra.cs.volume.VolumeManager;
/*    */ import com.zimbra.soap.JaxbUtil;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import com.zimbra.soap.admin.message.DeleteVolumeRequest;
/*    */ import com.zimbra.soap.admin.message.DeleteVolumeResponse;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public final class DeleteVolume
/*    */   extends AdminDocumentHandler
/*    */ {
/*    */   public Element handle(Element req, Map<String, Object> ctx)
/*    */     throws ServiceException
/*    */   {
/* 38 */     ZimbraSoapContext zsc = getZimbraSoapContext(ctx);
/* 39 */     return zsc.jaxbToElement(handle((DeleteVolumeRequest)JaxbUtil.elementToJaxb(req), ctx));
/*    */   }
/*    */   
/*    */   private DeleteVolumeResponse handle(DeleteVolumeRequest req, Map<String, Object> ctx) throws ServiceException {
/* 43 */     ZimbraSoapContext zsc = getZimbraSoapContext(ctx);
/* 44 */     checkRight(zsc, ctx, Provisioning.getInstance().getLocalServer(), Rights.Admin.R_manageVolume);
/*    */     
/* 46 */     VolumeManager mgr = VolumeManager.getInstance();
/* 47 */     mgr.getVolume(req.getId());
/* 48 */     mgr.delete(req.getId());
/* 49 */     return new DeleteVolumeResponse();
/*    */   }
/*    */   
/*    */   public void docRights(List<AdminRight> relatedRights, List<String> notes)
/*    */   {
/* 54 */     relatedRights.add(Rights.Admin.R_manageVolume);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/admin/DeleteVolume.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */